using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;


namespace Blople.GameComponents
{
    public class Pointer : Microsoft.Xna.Framework.DrawableGameComponent
    {
        protected SpriteBatch sBatch; 
        
        protected Texture2D texture;

        protected Vector2 position;
        protected float direction;

        protected const int WIDTH = 100;
        protected const int HEIGHT = 100;

        static readonly Rectangle frame = new Rectangle(0, 0, WIDTH, HEIGHT);

        public Pointer(Game game, Texture2D texture) : base(game)
        {
            this.texture = texture;
            direction = 0.0f;
            position = new Vector2(250, 625);
        }

        public override void Initialize()
        {
            base.Initialize();
        }

        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);
        }

        public override void Draw(GameTime gameTime)
        {
            sBatch = (SpriteBatch)Game.Services.GetService(typeof(SpriteBatch));
            sBatch.Draw(texture, position, frame, Color.White, direction, new Vector2(frame.Width / 2, frame.Height / 2), 1.0f, SpriteEffects.None, 0.3f);
            base.Draw(gameTime);
        }

        public float Direction
        {
            get { return direction; }
            set { direction = value; }
        }
    }
}
